/**
 * 商品相关API
 */

import {
	http,
	Method
} from "@/utils/request.js";

/**
 * 获取商品分类列表
 */
export function getCategoryList(params) {
	return http.request({
		url: `/api/goods/getCategoryList`,
		method: Method.GET,
		params
	});
}


/**
 * 查询商品列表
 */
export function getGoodsList(params) {
	return http.request({
		url: `/api/goods/list`,
		method: Method.GET,
		params
	});
}


/**
 * 获取商品详情
 */
export function getGoodsDetail(params) {
	return http.request({
		url: `/api/goods/detail`,
		method: Method.GET,
		params
	});
}

/**
 * 获取商户列表
 */
export function merchantList(params) {
	return http.request({
		url: `/api/goods/merchantList`,
		method: Method.GET,
		params
	});
}

/**
 * 添加收藏
 */
export function addFavorite(params) {
	return http.request({
		url: `/api/goods/addFavorite`,
		method: Method.POST,
		data: params
	});
}


/**
 * 取消收藏
 */
export function removeFavorite(params) {
	return http.request({
		url: `/api/goods/removeFavorite`,
		method: Method.POST,
		data: params
	});
}


/**
 * 收藏列表
 */
export function favoriteList(params) {
	return http.request({
		url: `/api/goods/favoriteList`,
		method: Method.GET,
		params
	});
}

/**
 * 获取商户详情
 */
export function merchantDetail(params) {
	return http.request({
		url: `/api/goods/merchantDetail`,
		method: Method.GET,
		params
	});
}

/**
 * 提交实名认证
 */
export function applyDistribution(params) {
	return http.request({
		url: `/api/userVerification/submit`,
		method: Method.POST,
		data: params
	});
}

/**
 * 获取实名认证信息
 */
export function distribution(params) {
	return http.request({
		url: `/api/userVerification/info`,
		method: Method.POST,
		data: params
	});
}